Skip to content

JS: Remove parenthesized expressions from AST#21427

Draft
asgerf wants to merge 11 commits intogithub:mainfrom
asgerf:js/parenthesized-expressions
Draft

JS: Remove parenthesized expressions from AST#21427
asgerf wants to merge 11 commits intogithub:mainfrom
asgerf:js/parenthesized-expressions

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Mar 9, 2026

No description provided.

@github-actions github-actions bot added the JS label Mar 9, 2026
@asgerf asgerf force-pushed the js/parenthesized-expressions branch from 7546aa1 to c972e07 Compare March 9, 2026 09:29
asgerf and others added 11 commits March 11, 2026 13:53
The LanguageVersionTests require all relations with multiple columns
to have dependency stats between each pair of columns. The
has_parentheses relation was missing these dependency entries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When a parenthesized expression is the callee/object of an optional
chain step (e.g. `(null)?.()`), the postVisitChainable method was
writing CFG successor edges FROM the ParenthesizedExpression node.
Since ParenthesizedExpression nodes are now bypassed and have no DB
entry, this caused VALUE_NOT_IN_TYPE errors in the successor relation.

Fix by unwrapping ParenthesizedExpression before writing the successor
edge, so the edge is written from the inner expression instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- WhitespaceContradictsPrecedence: suppress false positives where
  parenthesized inner expressions explicitly clarify precedence
- ExprHasNoEffect: continue flagging parenthesized anonymous function
  expressions as useless (they are valid code, not syntax errors)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asgerf asgerf force-pushed the js/parenthesized-expressions branch 2 times, most recently from bd0a882 to c3241a0 Compare March 11, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant